import requests
from bs4 import BeautifulSoup
import re

url = 'https://www.kuaidaili.com/free/inha/' + '1'
header = {
    'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.182 Safari/537.36'
}
r = requests.get(url,headers=header)
soup = BeautifulSoup(r.text,'lxml')
ip = soup.find_all('td',{'data-title':'IP'})
port = soup.find_all('td',{'data-title':'PORT'})
proxies = []
for ip,port in zip(ip,port):
    ip = ip.get_text()
    port = port.get_text()
    proxy = ip + ':' + port
    proxies.append(proxy)

for i in proxies:
    proxy = {
        'http':i,
        'https':i
    }
    print(proxy)
print(proxies)

